<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libCZI: Multi-channel-composition</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libCZI
   </div>
   <div id="projectbrief">Reading CZI documents made easy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('multichannelcomposition.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Multi-channel-composition </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Multi-channel-composition is the operation of combining a set of channels (usually grayscale images) into a one colored image. <br />
 The operation (as implemented by the function Compositors::ComposeMultiChannel) is controlled by the following options:</p>
<ul>
<li>tinting by a color</li>
<li>definition of a black- and white-point</li>
<li>a gradiation curve</li>
</ul>
<p>The steps in the operation are: </p><pre class="fragment">Let result R-G-B pixel value = 0,0,0
For each channel  
    If tinting is enabled for this channel:
        - get normalized pixel value
        - apply gradation
        - multiply with R-G-B tinting color
        - add R-G-B value to result pixel 

    If tinting is disabled for this channel:
        - get normalized R-G-B value
        - apply gradation to R, G and B
        - add R-G-B value to result pixel 
</pre><p>The operation "Apply gradiation" works in the following way: the normalized pixel value is mapped to an integer (in the range 0..255) by looking up a value:</p>
<div class="image">
<img src="gradationcurve_1.PNG" alt="gradationcurve_1.PNG"/>
<div class="caption">
linear gradation curve</div></div>
 Above a linear gradation curve is shown. There are three ways commonly used to define the gradation curve:</p><ul>
<li>linear (a straight line from the point [black point,0] to [white point,255] - as shown above)</li>
<li>gamma (instead of a straight line we use an exponential with the exponent gamma as a parameter)</li>
<li>defined by a spline</li>
</ul>
<p>In the function Compositors::ComposeMultiChannel the gradation curve is given as an array of bytes. Those bytes give the RGB-value at uniformly distributed points between black point and white point. Values between those points are interpolated linearly.</p>
<p>For example, the parameters white_point=0.2, black_point=1.0 and lookupTable={0, 66, 100, 166, 255} will result in this gradation curve:</p>
<div class="image">
<img src="gradationcurve_2.PNG" alt="gradationcurve_2.PNG"/>
<div class="caption">
gradation curve sample</div></div>
 For generating a look-up-table (which then can be used for Compositors::ComposeMultiChannel) two utility functions are provided: Utils::Create8BitLookUpTableFromSplines and Utils::Create8BitLookUpTableFromGamma. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
